<?php

$db =  new BukuTamu();
$table 	= "bukutamu";
$id  = "";
$order = "idbukutamu";
$bukutamu = $db->lihat ($table,$id,$order);

if ($bukutamu) {
	
	$o .= '<table class="table table-striped table-bordered table-condensed">
			<tr>
				<th><center>No</th>
				<th><center>Nama</th>
				<th><center>Email</th>
				<th><center>Pesan</th>
				<th><center>User</th>
				<th><center>Action</th>
			</tr>';
	
	$no = 1;
	
	foreach($bukutamu as $x) {
		
		$o .= '<tr>
					<td><center>'.$no.'</td>
					<td><center>'.$x['nama'].'</td>
					<td><center>'.$x['email'].'</td>
					<td><center>'.$x['isi_bukutamu'].'</td>
					<td><center>'.$x['username'].'</td>
					<td><center><a href="?page=balas&id='.$x['idbukutamu'].'"><i class="icon-zoom-in"></i>balas</a></td>
			  </tr>';
			  
		$no++;
		
	}

	$o .= '</table>';

} else {

	$o .= '<div class="alert alert-error">
		  <center>Data kosong</center>
		  </div>';
} 

echo $o;
